package a.f;

import a.c.bb;
import a.c.*;
import a.c.z;
import a.i.p;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class kb
  implements vc
{
  public static final Object e = "y.layout.BendConverter#SCOPE_DPKEY";
  private rc f;
  private double g;
  private k h;
  private k i;
  private k j;
  private k k;
  private k l;
  private Map m;
  private Map n;
  private boolean o;
  private boolean p;
  private boolean q;
  Object r;
  public static int s;
  
  public kb()
  {
    this(1.0D);
  }
  
  public kb(double paramDouble)
  {
    if (!o.eg)
    {
      if (paramDouble < 0.0D) {
        throw new IllegalArgumentException("Size must be non-negative");
      }
      this.g = paramDouble;
      this.o = true;
      this.p = true;
      this.q = true;
      this.r = rc.d;
    }
  }
  
  public boolean canLayout(o paramo)
  {
    boolean bool = o.eg;
    if ((bool) || (this.f != null)) {
      if (bool) {
        break label33;
      }
    }
    label33:
    return this.f.canLayout(paramo);
  }
  
  public void doLayout(o paramo)
  {
    if (!o.eg)
    {
      if (this.f != null) {
        a(paramo);
      }
    }
    else
    {
      this.f.doLayout(paramo);
      b(paramo);
    }
  }
  
  protected void a(o paramo)
  {
    boolean bool = o.eg;
    int i2 = o.dg;
    this.n = new HashMap();
    this.m = new HashMap();
    k localk = paramo.c(e);
    Object localObject1 = paramo.w();
    Object localObject2;
    label384:
    label386:
    do
    {
      if (!((m)localObject1).e()) {
        break;
      }
      localObject2 = ((m)localObject1).a();
      if (i2 != 0) {
        break label409;
      }
      if ((localk == null) || (localk.getBool(localObject2)))
      {
        do
        {
          zb localzb = paramo.e(localObject2);
          if (localzb.a() <= 0) {
            break;
          }
          bb localbb = new bb();
          this.n.put(localObject2, localbb);
          Object localObject3 = ((d)localObject2).e();
          int i1 = 0;
          do
          {
            if (i1 >= localzb.a()) {
              break;
            }
            localObject4 = localzb.a(i1);
            localObject5 = paramo.i();
            localObject6 = paramo.d(localObject5);
            localbb.add(localObject5);
            ((zc)localObject6).b(this.g, this.g);
            ((zc)localObject6).a(((a.d.w)localObject4).a - this.g * 0.5D, ((a.d.w)localObject4).b - this.g * 0.5D);
            d locald2 = paramo.a((e)localObject3, (e)localObject5);
            this.m.put(locald2, localObject2);
            localObject3 = localObject5;
            i1++;
            if (bool) {
              break label386;
            }
            if (i2 != 0) {
              break label384;
            }
          } while (i2 == 0);
          d locald1 = paramo.a((e)localObject3, ((d)localObject2).f());
          this.m.put(locald1, localObject2);
          Object localObject4 = paramo.e(locald1);
          ((zb)localObject4).b(localzb.d());
          Object localObject5 = localbb.m().i();
          Object localObject6 = paramo.e(localObject5);
          ((zb)localObject6).a(localzb.c());
          a(paramo, (d)localObject2, localbb);
        } while (bool);
        paramo.f((d)localObject2);
      }
      ((m)localObject1).f();
    } while (i2 == 0);
    this.h = paramo.c(ed.a);
    if (!bool)
    {
      if (this.h != null)
      {
        label409:
        if (bool) {
          break label453;
        }
        if (c())
        {
          localObject1 = new p()
          {
            public Object get(Object paramAnonymousObject)
            {
              boolean bool = o.eg;
              Object localObject = kb.this.m.get(paramAnonymousObject);
              if (!bool) {
                if (localObject == null) {
                  return kb.this.h.get(paramAnonymousObject);
                }
              }
              d locald = (d)paramAnonymousObject;
              if ((bool) || (kb.this.a(locald, kb.this.m))) {
                return kb.this.h.get(localObject);
              }
              return null;
            }
          };
          paramo.a(ed.a, (k)localObject1);
        }
      }
      this.i = paramo.c(ed.b);
    }
    label453:
    if (!bool)
    {
      if (this.i != null)
      {
        if (bool) {
          break label505;
        }
        if (c())
        {
          localObject1 = new p()
          {
            public Object get(Object paramAnonymousObject)
            {
              boolean bool = o.eg;
              Object localObject = kb.this.m.get(paramAnonymousObject);
              if (!bool) {
                if (localObject == null) {
                  return kb.this.i.get(paramAnonymousObject);
                }
              }
              d locald = (d)paramAnonymousObject;
              if ((bool) || (kb.this.b(locald, kb.this.m))) {
                return kb.this.i.get(localObject);
              }
              return null;
            }
          };
          paramo.a(ed.b, (k)localObject1);
        }
      }
      this.k = paramo.c(ed.c);
    }
    label505:
    if (!bool)
    {
      if (this.k != null)
      {
        if (bool) {
          break label557;
        }
        if (b())
        {
          localObject1 = new p()
          {
            public Object get(Object paramAnonymousObject)
            {
              boolean bool = o.eg;
              Object localObject = kb.this.m.get(paramAnonymousObject);
              if (!bool) {
                if (localObject == null) {
                  return kb.this.k.get(paramAnonymousObject);
                }
              }
              d locald = (d)paramAnonymousObject;
              if ((bool) || (kb.this.a(locald, kb.this.m))) {
                return kb.this.k.get(localObject);
              }
              return null;
            }
          };
          paramo.a(ed.c, (k)localObject1);
        }
      }
      this.j = paramo.c(ed.d);
    }
    label557:
    if (!bool)
    {
      if (this.j != null)
      {
        if (bool) {
          break label612;
        }
        if (b())
        {
          localObject1 = new p()
          {
            public Object get(Object paramAnonymousObject)
            {
              boolean bool = o.eg;
              Object localObject = kb.this.m.get(paramAnonymousObject);
              if (!bool) {
                if (localObject == null) {
                  return kb.this.j.get(paramAnonymousObject);
                }
              }
              d locald = (d)paramAnonymousObject;
              if ((bool) || (kb.this.b(locald, kb.this.m))) {
                return kb.this.j.get(localObject);
              }
              return null;
            }
          };
          paramo.a(ed.d, (k)localObject1);
        }
      }
      localObject1 = e();
      this.l = paramo.c(localObject1);
    }
    label612:
    if ((bool) || (this.l != null)) {
      if (d())
      {
        localObject2 = new p()
        {
          public boolean getBool(Object paramAnonymousObject)
          {
            Object localObject = kb.this.m.get(paramAnonymousObject);
            return localObject != null ? kb.this.l.getBool(localObject) : kb.this.l.getBool(paramAnonymousObject);
          }
        };
        paramo.a(e(), (k)localObject2);
      }
    }
  }
  
  protected void b(o paramo)
  {
    boolean bool = o.eg;
    int i1 = o.dg;
    Object localObject = this.n.entrySet().iterator();
    if (((Iterator)localObject).hasNext()) {}
    label329:
    label331:
    while (bool)
    {
      Map.Entry localEntry = (Map.Entry)((Iterator)localObject).next();
      d locald1 = (d)localEntry.getKey();
      paramo.g(locald1);
      zb localzb = paramo.e(localEntry.getKey());
      bb localbb = (bb)localEntry.getValue();
      z localz = new z();
      e locale1 = localbb.m();
      e locale2 = localbb.n();
      d locald2 = locale1.i();
      a.d.w localw1 = paramo.e(locale2.h()).d();
      a.d.w localw2 = paramo.e(locale1.i()).c();
      localz.a(paramo.m(locald2));
      if (bool) {
        break label349;
      }
      if (i1 != 0) {
        break label343;
      }
      a.c.w localw = localbb.l();
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale3 = localw.d();
        zc localzc = paramo.d(locale3);
        localz.add(new a.d.w(localzc.a() + 0.5D * localzc.c(), localzc.b() + 0.5D * localzc.d()));
        locald2 = locale3.h();
        localz.a(paramo.m(locald2));
        paramo.a(locale3);
        localw.f();
        if (bool) {
          break label331;
        }
        if (i1 != 0) {
          break label329;
        }
      } while (i1 == 0);
      localzb.a(localw2);
      localzb.b(localw1);
      if (bool) {
        break label346;
      }
      paramo.b(locald1, localz);
      if (i1 == 0) {
        break;
      }
    }
    label343:
    localObject = e();
    label346:
    paramo.j(localObject);
    label349:
    if (!bool)
    {
      if (this.l != null) {
        paramo.a(localObject, this.l);
      }
      this.l = null;
      paramo.j(ed.a);
    }
    if (!bool)
    {
      if (this.h != null) {
        paramo.a(ed.a, this.h);
      }
      this.h = null;
      paramo.j(ed.b);
    }
    if (!bool)
    {
      if (this.i != null) {
        paramo.a(ed.b, this.i);
      }
      this.i = null;
      paramo.j(ed.c);
    }
    if (!bool)
    {
      if (this.k != null) {
        paramo.a(ed.c, this.k);
      }
      this.k = null;
      paramo.j(ed.d);
      if (bool) {}
    }
    else
    {
      if (this.j != null) {
        paramo.a(ed.d, this.j);
      }
      this.j = null;
      this.m = null;
    }
    this.n = null;
  }
  
  private boolean a(d paramd, Map paramMap)
  {
    if (!o.eg) {}
    return (paramd.e().d() != 1) || (paramMap.get(paramd.e().i()) == null);
  }
  
  private boolean b(d paramd, Map paramMap)
  {
    if (!o.eg) {}
    return (paramd.f().d() != 1) || (paramMap.get(paramd.f().h()) == null);
  }
  
  public rc a()
  {
    return this.f;
  }
  
  public void a(rc paramrc)
  {
    this.f = paramrc;
  }
  
  public boolean b()
  {
    return this.q;
  }
  
  public void a(boolean paramBoolean)
  {
    this.q = paramBoolean;
  }
  
  public boolean c()
  {
    return this.p;
  }
  
  public void b(boolean paramBoolean)
  {
    this.p = paramBoolean;
  }
  
  public boolean d()
  {
    return this.o;
  }
  
  public void c(boolean paramBoolean)
  {
    this.o = paramBoolean;
  }
  
  protected void a(o paramo, d paramd, bb parambb) {}
  
  public Object e()
  {
    return this.r;
  }
  
  public void a(Object paramObject)
  {
    if (paramObject == null) {
      throw new IllegalArgumentException("null");
    }
    this.r = paramObject;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.kb

 * JD-Core Version:    0.7.0.1

 */